use strict;
use warnings;
use Test::More 'no_plan';
use URI;
use File::Slurp;

use Carp 'confess';
$SIG{__DIE__} = \&confess;

BEGIN { use_ok 'Text::Microformat' }
use Data::Dumper;
$Data::Dumper::Terse = 1;
$Data::Dumper::Useqq = 1;
my $uformat = Text::Microformat->new(<<'EOT', content_type => 'application/xml');
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<item>
			<title>Test Number One</title>
			<link>http://example.com/1</link>
			<description><![CDATA[
				<div class="vcard">
					<span class="fn org" title="Zaphod Beeblebrox">Zaph</span>
				</div>
			]]></description>
		</item>
		<item>
			<title>Test Number Two</title>
			<link>http://example.com/2</link>
			<description>
				&lt;div class=&quot;vcard&quot;&gt;
					&lt;span class=&quot;fn org&quot; title=&quot;Ford Prefect&quot;&gt;Ford&lt;/span&gt;
				&lt;/div&gt;
			</description>
		</item>
		
	</channel>
</rss>
EOT
my @things = $uformat->find;
is($things[0]->Get('fn'), 'Zaphod Beeblebrox');
is($things[1]->Get('fn'), 'Ford Prefect');
